package org.mozhu.mboot.admin.maintain.notification.entity;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.mozhu.mboot.core.data.entity.BaseEntity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * 通知 - 实体类
 */
@Entity
@Table(name = "maintain_notification")
@Data
@EqualsAndHashCode(callSuper = true)
public class Notification extends BaseEntity {

	private static final long serialVersionUID = -6238855048391924816L;

	/**
	 * 接收通知的用户
	 */
	@Column(name = "user_id")
	private Long userId;

	/**
	 * 通知所属系统
	 */
	@Enumerated(EnumType.STRING)
	private NotificationModule module;

	private String title;
	/**
	 * 通知内容
	 */
	@Column(length = 5000)
	private String content;

	/**
	 * 通知时间
	 */
	@Column(name = "date")
	@Temporal(TemporalType.TIMESTAMP)
	private Date date;

	/**
	 * 是否已读
	 */
	@Column(name = "is_read")
	private Boolean read = Boolean.FALSE;

}
